﻿using System;

namespace HobSoft.SoccerBet2014.Domain.Common.Site.Component
{
    using Models.Site;
    public class LoginInfo : ILoginInfo
    {
        public LoginInfo(string sessionId)
        {
            SessionID = sessionId;
        }
        public bool IsLogin { get; internal set; }

        public LoginState State
        {
            get;
            internal set;
        }

        public DateTime? LoginTime { get; protected set; }

        public DateTime? LastRequestTime { get; internal set; }
        public string LastRequestResult { get; protected set; }
        public string SessionID { get; protected set; }
        public string SessionValue { get; protected set; }

        internal void ResetLogin(string sessionValue)
        {
            IsLogin = true;
            LoginTime = DateTime.Now;
            LastRequestTime = DateTime.Now;
            SessionValue = sessionValue;
        }

        internal void Reset()
        {
            LastRequestTime = DateTime.Now;
        }

        internal void Reset(string html)
        {
            LastRequestTime = DateTime.Now;
            LastRequestResult = html;
        }

    }

}
